// 为查询文本框添加回车事件
function SubmitKeyClick(obj, evt) {
    evt = (evt) ? evt : ((window.event) ? window.event : "");
    var key_code = evt.keyCode ? evt.keyCode : (evt.which ? evt.which : evt.charCode);
    if (key_code == 13) {
        find_bl();
    }
}

function find_bl() {
    var cy_id = $("#shipowner_cy_id").val();
    var forward_id = $("#shipowner_forward_id").val();
    var port_id = $("#shipowner_port_id").val();
    var voyage = $("#shipowner_voyage").val();
    var route = $("#shipowner_route").val();
    var course = $("#shipowner_course").val();
    var bl_no = $("#shipowner_bl_no").val();

    Ht.waitingBtn("query-btn", "查询中");

    show_shelter();

    var params = {};
    if (cy_id && $.trim(cy_id))
        params['cy_id'] = cy_id;
    if (forward_id && $.trim(forward_id))
        params['forward_id'] = forward_id;
    if (port_id && $.trim(port_id))
        params['port_id'] = port_id;
    if (voyage && $.trim(voyage))
        params['voyage'] = voyage;
    if (route && $.trim(route))
        params['route'] = route;
    if (course && $.trim(course))
        params['course'] = course;
    if (bl_no && $.trim(bl_no))
        params['bl_no'] = bl_no;

    $.get("/shipowner_maps", params, function(data) {
        Ht.stopWaiting("query-btn");
        hide_shelter();

        $("#rst_info_view").html(data.html);
        show_notice(data.notice);
        resetMap();
        transGps2Location();
        markVehicle();
    }, "json");
}
